using System;
using System.Collections.Generic;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Text;

namespace Weever.Json.Binding
{
    public class JsonSerializerFormat: Attribute, IOperationBehavior 
    {
        public void Validate(OperationDescription operationDescription)
        {
            
        }

        public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
        {
            
            dispatchOperation.Formatter = new JsonDispatchMessageFormatter(dispatchOperation.Formatter);
        }

        public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
        {
            clientOperation.Formatter = new JsonClientMessageFormatter(clientOperation.Formatter);
        }

        public void AddBindingParameters(OperationDescription operationDescription,
                                         BindingParameterCollection bindingParameters)
        {
            
        }
    }
}
